using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Geomatrix
{
    class MainMenu
    {
        Button randomLevel;
        Button levelSelect;
        Button quit;
        Texture2D _backTex;

        public MainMenu(Texture2D butTex, Texture2D backTex)
        {
            randomLevel = new Button(new Vector2(36, 150), butTex, "Random");
            levelSelect = new Button(new Vector2(36, 220), butTex, "Level Select");
            quit = new Button(new Vector2(36, 290), butTex, "Quit");

            _backTex = backTex;
        }

        public int Update(TouchCollection tc)
        {
            randomLevel.Update(tc);
            if (levelSelect.Update(tc))
                return 1;
            if (quit.Update(tc))
                return -1;

            return 0; //If true is returned than end game.
        }

        public void Draw(SpriteBatch sb)
        {
            sb.Draw(_backTex, new Vector2(0, 0), Color.White);
            randomLevel.Draw(sb);
            levelSelect.Draw(sb);
            quit.Draw(sb);
        }
    }
}